
public class CircularBufferTest {
    final int bufferSize;
    final int producers;
    final int consumers;
    //-------------------------------------------------------
    public CircularBufferTest(int bufferSize, int producers, int consumers) {
        this.bufferSize = bufferSize;
        this.producers = producers;
        this.consumers = consumers;
        Buffer buffer = new CircularBuffer(bufferSize);
        for (int i = 0; i < producers; i++) {
            new Thread(new Producer((CircularBuffer) buffer)).start();
        }
        for (int i = 0; i < consumers; i++) {
            new Thread(new Consumer(buffer)).start();
        }
    }
    //-------------------------------------------------------
}//End class CircularBufferTest
